//ctx的值为"http://localhost:8080/xungou/"
window.ctx = location.origin+"/"+location.pathname.split('/')[1]+"/";

$(function() {
	$.ajaxSetup({
		error : function(XMLHttpRequest, textStatus, errorThrown) {
//			alert(XMLHttpRequest.status);
//			alert(XMLHttpRequest.readyState);
//			alert(textStatus);
		},
		dataType : "JSON",
		type : "POST"
	});
});